<?php

namespace IDock\Insurance\ZFIC;

use IDock\IDock\IDockInterface;
use IDock\Insurance\ZFIC\Request\CancelOrderNoRequest;
use IDock\Insurance\ZFIC\Request\CarModelQueryBXRequest;
use IDock\Insurance\ZFIC\Request\CarModelQueryRequest;
use IDock\Insurance\ZFIC\Request\GetCarVerifyCodeRequest;
use IDock\Insurance\ZFIC\Request\GetOrderNoRequest;
use IDock\Insurance\ZFIC\Request\GetPaymentUrlRequest;
use IDock\Insurance\ZFIC\Request\GetVerifyCodeRequest;
use IDock\Insurance\ZFIC\Request\InsuranceConfirmRequest;
use IDock\Insurance\ZFIC\Request\NonCarProductListRequest;
use IDock\Insurance\ZFIC\Request\OfferOrderPriceRequest;
use IDock\Insurance\ZFIC\Request\OrderCancelRequest;
use IDock\Insurance\ZFIC\Request\OrderPriceQueryRequest;
use IDock\Insurance\ZFIC\Request\OrderStatusQueryRequest;
use IDock\Insurance\ZFIC\Request\RenewalInquiryRequest;
use IDock\Insurance\ZFIC\Request\RevokeOrderNoRequest;
use IDock\Insurance\ZFIC\Request\UploadFileRequest;
use IDock\Insurance\ZFIC\Response\CancelOrderResponse;
use IDock\Insurance\ZFIC\Response\CommonResponse;
use IDock\Insurance\ZFIC\Response\InsuranceConfirmResponse;
use IDock\Insurance\ZFIC\Response\InsurancePriceQueryResponse;
use IDock\Insurance\ZFIC\Response\NonCarProductListResponse;
use IDock\Insurance\ZFIC\Response\OrderStatusQueryResponse;
use IDock\Insurance\ZFIC\Response\PolicyPaymentResponse;
use IDock\Insurance\ZFIC\Response\RenewalInquiryResponse;
use IDock\Insurance\ZFIC\Response\VehicleModelBXResponse;
use IDock\Insurance\ZFIC\Response\VehicleModelResponse;
use IDock\Printer\NonCar\NonCarInquiryPrinter;
use IDock\Printer\NonCar\NonCarInquirySinglePrinter;
use IDock\Printer\Premium\PremiumInquiryPrinter;
use IDock\Printer\PremiumUnderwritingPrinter;
use IDock\Printer\SpecialClausesPrinter;
use IDock\Printer\VehicleActualValuePrinter;
use IDock\Visitor\EPolicyDownloadVisitor;
use IDock\Visitor\NonCar\NonCarInquiryVisitor;
use IDock\Visitor\NonCar\NonCarProductListVisitor;
use IDock\Visitor\NonCar\NonCarProductVisitor;
use IDock\Visitor\PolicyInfoVisitor;
use IDock\Visitor\PolicyPaymentVisitor;
use IDock\Visitor\Premium\PremiumInquiryVisitor;
use IDock\Visitor\ProposalRecallVisitor;
use IDock\Visitor\ProposalStatusVisitor;
use IDock\Visitor\RenewalInquiryVisitor;
use IDock\Visitor\UnderwritingRecallVisitor;
use IDock\Visitor\UploadFileVisitor;
use IDock\Visitor\VehicleActualValueVisitor;
use IDock\Visitor\VehicleModelVisitor;

/**
 * 珠峰保险
 */
class ZFICConstruct extends Builder implements IDockInterface
{

    protected $config = [];

    public function __construct($config)
    {
        $this->config = $config;
        $this->chalCode = $config['chalCode'] ?? '';
        $this->userCode = $config['userCode'] ?? '';
        $this->productCode = $config['productCode'] ?? '';
        $this->planCode = $config['planCode'] ?? '';
        $this->planCodeNew = $config['planCodeNew'] ?? '';
    }

    /**
     * 车型查询
     * @param VehicleModelVisitor $vehicleModelVisitor
     * @return VehicleModelResponse
     */
    public function vehicleModel(VehicleModelVisitor $vehicleModelVisitor)
    {
        //先请求保信接口
        $request = new CarModelQueryBXRequest();
        $request->setVisitor($vehicleModelVisitor);
        /*** @var VehicleModelBXResponse $response */
        $response = $this->execute($request);
        if(!$response->isSuccess() or empty($response->printer->toArray())){
            $request = new CarModelQueryRequest();
            $request->setVisitor($vehicleModelVisitor);
            /*** @var VehicleModelResponse $response */
            $response = $this->execute($request);
            if ($response->totalCount > 10) {
                $request->totalCount = $response->totalCount;
                /*** @var VehicleModelResponse $response */
                $response = $this->execute($request);
            }
        }
        return $response;
    }

    /**
     * 续保查询
     * @param RenewalInquiryVisitor $renewalInquiryVisitor
     * @return RenewalInquiryResponse
     * @version 4.0
     */
    public function renewalInquiry(RenewalInquiryVisitor $renewalInquiryVisitor): RenewalInquiryResponse
    {
        $request = new RenewalInquiryRequest();
        $request->setVisitor($renewalInquiryVisitor);

        /*** @var RenewalInquiryResponse $response */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 车辆实际价格接口
     * @param VehicleActualValueVisitor $vehicleActualValueVisitor
     * @return
     */
    public function vehicleActualValue(VehicleActualValueVisitor $vehicleActualValueVisitor)
    {
        $response = new CommonResponse();
        $response->setCode('200');
        $vehicleActualValuePrinter = new VehicleActualValuePrinter();
        $response->printer = $vehicleActualValuePrinter;
        return $response;
    }

    /**
     * 询价前置
     * @param PremiumInquiryVisitor $premiumInquiryVisitor
     * @return
     */
    public function preInquiry(PremiumInquiryVisitor $premiumInquiryVisitor)
    {

    }

    public function validateCar(PremiumInquiryVisitor $premiumInquiryVisitor)
    {
        // TODO: Implement validateCar() method.
    }

    /**
     * 询价
     * @param PremiumInquiryVisitor $premiumInquiryVisitor
     * @return InsurancePriceQueryResponse
     * @throws \Exception
     */
    public function premiumInquiry(PremiumInquiryVisitor $premiumInquiryVisitor): InsurancePriceQueryResponse
    {
        $request = new OrderPriceQueryRequest();
        $request->setVisitor($premiumInquiryVisitor);

        $response = $this->execute($request);

        if ($response->getLogicCode() != '200') {
            throw new \Exception($response->getError());
        }
        $data = $response->getData();

        $actualPrice = $data['carInfo']['actualValue'] ?? '';
        $platOrderNo = $data['platOrderNo'] ?? '';
        $carClauseVMList = $data['carClauseVMList'] ?? [];

        $premiumInquiryVisitor->getVehicleVisitor()->actualValue = $actualPrice;//协商价格
        $premiumInquiryVisitor->getExtInfoVisitor()->argc['platOrderNo'] = $platOrderNo;
        $coverageList = $data['kindList'] ?? [];
        $engageList = $data['carClauseVMList'] ?? [];

        $request1 = new OfferOrderPriceRequest();
        $request1->setVisitor($premiumInquiryVisitor);
        $request1->setCoverageList($coverageList);

        /*** @var InsurancePriceQueryResponse $response */
        //$testResponse = '{"state":200,"msg":"OK","data":{"platOrderNo":"C20231109112453453000209624","businessNo":"HX202311091124538811","syStartDate":"2023-11-10 00:00:00","syEndDate":"2024-11-09 23:59:59","jqStartDate":"2023-12-04 00:00:00","jqEndDate":"2024-12-03 23:59:59","messageJQX":"交强险平台校验：成功","messageSYX":"商业险平台校验：成功 投保查询码：V0101ZFIC510023110369499413191 平台校验，重复投保。 保单号：ACHD0EKY2022B044134Z 承保地区：510000; 保险公司：CPIC; 险种名称：第三者责任保险; 险种名称：车辆损失保险; 险种名称：车上人员责任保险（乘客）; 险种名称：车上人员责任保险（司机）; 号牌号码：川AML534; 号牌种类代码：02; 号牌底色：01; 车辆识别代号：LFV2A2154J6046207; 发动机号：N43826; 起保日期：2022-12-05; 终保日期：2023-12-05; 签单日期：2022-11-09","jqLastYearStartDate":"2023-12-04 00:00:00","jqLastYearEndDate":"2023-12-04 00:00:00","syLastYearEndDate":"2023-12-05 00:00:00","kindList":[{"kindCode":"BZ","amount":"200000.0","premium":"950.0","hasRelatedInd":"0","rate":"0E-7","benchmarkPremium":"950.0","discount":"100.0","zfGrade":""},{"kindCode":"001","amount":"79328.8","premium":"1715.16","hasRelatedInd":"0","rate":"1.6216","benchmarkPremium":"1715.16","discount":"100.0","zfGrade":""},{"kindCode":"002","amount":"2000000.0","premium":"832.67","hasRelatedInd":"0","rate":"0.0","benchmarkPremium":"832.67","discount":"100.0","zfGrade":""},{"kindCode":"0041","amount":"10000.0","premium":"28.29","hasRelatedInd":"0","unitAmount":"10000","quantity":"1","rate":"0.2122","benchmarkPremium":"28.29","discount":"100.0","zfGrade":""},{"kindCode":"0044","amount":"40000.0","premium":"71.79","hasRelatedInd":"0","unitAmount":"10000","quantity":"4","rate":"0.1346","benchmarkPremium":"71.79","discount":"100.0","zfGrade":""}],"carShipTax":{"platOrderNo":"C20231109112453453000209624","itemNo":"1","taxRelifFlag":"02","taxItemDetailCode":"02","taxItemDetailName":"1.0至1.6升(含)客车","caculateMode":"1","vehicleCategory":"K33","taxPayerIdentifier":"513022199708014355","taxPayerName":"陈仕茂","certiType":"01","identifyNumber":"513022199708014355","completeKerbMass":1.2700,"taxDue":"300.0","taxUnitText":"1","taxStartDate":"2023-01-01","taxEndDate":"2023-12-31","newLicenseFlag":"O","calcTaxFlag":"1","sumPayTax":300.0,"lateFee":0.0,"previousPay":0.0,"taxDueActual":300.0,"taxRelief":"0.0","taxRegistryNumber":"91510104MA62MP9U0D","oldTaxRelifFlag":"02"},"rateList":[{"platOrderNo":"C20231109112453453000209624","riskCode":"0808","profitType":"UNIT","profitCode":"F03","profitName":"无赔款优待系数","subProfitName":"","subProfitCode":"","rate":"100.0","remark":"1"},{"platOrderNo":"C20231109112453453000209624","riskCode":"0808","profitType":"UNIT","profitCode":"F04","profitName":"交通违法系数","subProfitName":"","subProfitCode":"","rate":"100.0","remark":"1"},{"platOrderNo":"C20231109112453453000209624","riskCode":"0808","profitType":"UNIT","profitCode":"F05","profitName":"自主定价系数","subProfitName":"","subProfitCode":"","rate":"100.0","remark":"1"}],"reInsureItem":{"policyNo":"保单号：ACHD0EKY2022B044134Z","insurerCode":"保险公司：CPIC;","coverageItem":"险种名称:第三者责任保险;车辆损失保险;车上人员责任保险（乘客）;车上人员责任保险（司机）;","licensePlateNo":"号牌号码：川AML534;","licensePlateType":"号牌种类代码：02;","licensePlateColorCode":"号牌底色：01;","vin":"车辆识别代号：LFV2A2154J6046207;","engineNo":"发动机号：N43826;","effectiveDate":"2022-12-05 00:00:00","expireDate":"2023-12-05 00:00:00","billDate":"2022-11-09 00:00:00","insurerArea":"承保地区：510000;","querySequenceNo":"投保查询码：V0101ZFIC510023110369499413191"},"ebciInsureRiskItemList":[{"profitCode":"F03","ciAdjustReason":"","ciAdjustReasonName":"","noAdjustReason":"01","noAdjustReasonName":"过户车，不浮动"}],"renewal":{"questionJQ":"","questionSY":"","querySequenceNoJQ":"01ZFIC510023110519499391929169","querySequenceNoSY":"V0101ZFIC510023110369499413191","renewalFlag0801":"","renewalFlag0802":""}}}';
        //$GLOBALS['testResponse'] = $testResponse;
        $response = $this->execute($request1);
        /** @var PremiumInquiryPrinter $printer * */
        $printer = $response->getPrinter();
        //if(empty($printer->repeatInsurePrinter['biStartData']) && !empty($printer->repeatInsurePrinter['ciStartData'])){
        //    $printer->repeatInsurePrinter['biStartData'] = $printer->repeatInsurePrinter['ciStartData'];
        //}
        //if(!empty($printer->repeatInsurePrinter['biStartData']) && empty($printer->repeatInsurePrinter['ciStartData'])){
        //    $printer->repeatInsurePrinter['ciStartData'] = $printer->repeatInsurePrinter['biStartData'];
        //}
        $printer->argc['isNewCar'] = $premiumInquiryVisitor->getVehicleVisitor()->isNewVehicle;
        //特约
        foreach ($engageList as $val) {
            $engage = new SpecialClausesPrinter();
            $engage->clauseName = $val['clauseName'];
            $engage->clauseCode = $val['clauseCode'];
            $engage->clauseContent = $val['context'];
            $engage->autoFlag = $val['needFlag'] == 'Y' ? '1' : '0';
            $engage->riskType = $val['riskCode'] == '0801' ? 'TCI' : 'VCI';//交强险可选特约
            $printer->specialClausesAppend($engage);
        }
        //业务等级
        if ($printer->premiumFactorPrinter) {
            $printer->premiumFactorPrinter->ComFactorAppend('业务等级', 'businessLevel', $premiumInquiryVisitor->getExtInfoVisitor()->argc['businessLevel']);
        }

        //非车结果回填
        $nonCarInquiryPrinter = new NonCarInquiryPrinter();
        $totalPremium = 0;
        foreach ($premiumInquiryVisitor->getNonCarInquiryVisitor()->getNonCarList() as $item) {
            /*** @var $item NonCarProductVisitor */
            $single = new NonCarInquirySinglePrinter();
            $single->premium = $item->premium;
            $single->planCode = $item->planCode;
            $single->productCode = $item->productCode;
            $single->statusCode = 'success';
            $totalPremium += $single->premium * $item->insuredNum;
            $nonCarInquiryPrinter->noCarInquirySingleAppend($single);
        }
        $nonCarInquiryPrinter->totalPremium = $totalPremium;

        $printer->nonCarInquiryPrinter = $nonCarInquiryPrinter;

        $response->printer = $printer;
        return $response;
    }

    /**
     * 核保
     * @param PremiumInquiryVisitor $premiumInquiryVisitor
     * @return InsuranceConfirmResponse
     */
    public function underwriting(PremiumInquiryVisitor $premiumInquiryVisitor): InsuranceConfirmResponse
    {
        $request = new InsuranceConfirmRequest();
        $request->setVisitor($premiumInquiryVisitor);

        /**@var InsuranceConfirmResponse $response **/
        $response = $this->execute($request);

        //非车数据回填重构
        /*** @var PremiumUnderwritingPrinter $printer */
        $printer = $response->getPrinter();
        if ($printer->noCarUnderwritingPrinter->statusCode == 'success' && !empty($premiumInquiryVisitor->getNonCarUnderwritingVisitor()->getNonCarList())) {

            /*** @var NonCarProductVisitor $nonProduct */
            $nonProduct = $premiumInquiryVisitor->getNonCarUnderwritingVisitor()->getNonCarList()[0];

            $nonCarList = $printer->noCarUnderwritingPrinter->getNonCarInquiryList();

            foreach ($nonCarList as &$value) {
                /*** @var NonCarInquirySinglePrinter $value */
                $value->productCode = $nonProduct->productCode;
                $value->planCode = $nonProduct->planCode;
            }
        }

        $response->printer = $printer;
        return $response;
    }

    /**
     * 获取支付链接
     * @param PolicyPaymentVisitor $paymentVisitor
     * @return
     */
    public function policyPayment(PolicyPaymentVisitor $paymentVisitor)
    {

        $request1 = new GetCarVerifyCodeRequest();
        $request1->setVisitor($paymentVisitor);


        $response1 = $this->execute($request1);

        $code = $response1->getData();
//        $code = 'ZF17Y0';

        $paymentVisitor->argc['ZFCode'] = $code ?? '';

        $request = new GetPaymentUrlRequest();
        $request->setVisitor($paymentVisitor);

        /**@var PolicyPaymentResponse $response * */
        $response = $this->execute($request);

        return $response;
    }

    public function proposalStatus(ProposalStatusVisitor $proposalStatusVisitor)
    {
        $request = new OrderStatusQueryRequest();
        $request->setVisitor($proposalStatusVisitor);

        /**
         * @var OrderStatusQueryResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    public function proposalRecall(ProposalRecallVisitor $revokeVisitor)
    {
        $request = new OrderCancelRequest();
        $request->setVisitor($revokeVisitor);

        /**
         * @var CancelOrderResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 撤单接口
     * @param UnderwritingRecallVisitor $recallVisitor
     * @return CancelOrderResponse
     */
    public function underwritingRecall(UnderwritingRecallVisitor $recallVisitor)
    {
        $request = new OrderCancelRequest();
        $request->setVisitor($recallVisitor);

        /**
         * @var CancelOrderResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    public function EPolicyDownload(EPolicyDownloadVisitor $EPolicyVisitor)
    {
        // TODO: Implement EPolicyDownload() method.
    }

    public function policyInfo(PolicyInfoVisitor $policyInfoVisitor)
    {
        $request = new OrderStatusQueryRequest();
        $request->setVisitor($policyInfoVisitor);

        /**
         * @var OrderStatusQueryResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }


    public function CarModelQuery($pageNo, $pageSize, $singeinDate, $vehicleName = '', $searchCode = '', $vehiclePriceBegin = '', $vehiclePriceEnd = '', $vehicleBrand = '', $vehicleClass = '', $vehicleSeries = '', $vehicleMaker = '', $modelCode = '', $vehicleId = '')
    {
        $request = new CarModelQueryRequest();
        $request->setPageNo($pageNo);
        $request->setPageSize($pageSize);
        $request->setSingeinDate($singeinDate);
        $request->setVehicleName($vehicleName);
        $request->setSearchCode($searchCode);
        $request->setVehiclePriceBegin($vehiclePriceBegin);
        $request->setVehiclePriceEnd($vehiclePriceEnd);
        $request->setVehicleBrand($vehicleBrand);
        $request->setVehicleClass($vehicleClass);
        $request->setVehicleSeries($vehicleSeries);
        $request->setVehicleMaker($vehicleMaker);
        $request->setModelCode($modelCode);
        $request->setVehicleId($vehicleId);
        /**
         * @var CommonResponse $response
         */
        $response = $this->execute($request);
        return $response;

    }

    public function OfferOrderPrice($param)
    {
        $request = new OfferOrderPriceRequest();
        $request->setplatOrderNo($param['platOrderNo'] ?? '');
        $request->setbusinessNo($param['businessNo'] ?? '');
        $request->setkindList($param['kindList'] ?? []);
        $request->setRateList($param['rateList'] ?? []);
        $request->setjqImmediateFlag($param['jqImmediateFlag'] ?? '');
        $request->setimmediateFlag($param['immediateFlag'] ?? '');
        $request->settaxRelifFlag($param['taxRelifFlag'] ?? '');
        $request->settaxPayerName($param['taxPayerName'] ?? '');
        $request->setcertiType($param['certiType'] ?? '');
        $request->setidentifyNumber($param['identifyNumber'] ?? '');
        $request->settaxCompancyCode($param['taxCompancyCode'] ?? '');
        $request->settaxCompancyName($param['taxCompancyName'] ?? '');
        $request->setrelifReason($param['relifReason'] ?? '');
        $request->setpaidFreeCertificate($param['paidFreeCertificate'] ?? '');
        $request->setdeductionDueType($param['deductionDueType'] ?? '');
        $request->setfreeRate($param['freeRate'] ?? '');
        $request->setnegotiatedActualValue($param['negotiatedActualValue'] ?? '');
        $request->setrenewalAnswerJQ($param['renewalAnswerJQ'] ?? '');
        $request->setrenewalAnswerSY($param['renewalAnswerSY'] ?? '');
        $request->setquerySequenceNoJQ($param['querySequenceNoJQ'] ?? '');
        $request->setquerySequenceNoSY($param['querySequenceNoSY'] ?? '');
        $request->setrenewalFlag0801($param['renewalFlag0801'] ?? '');
        $request->setrenewalFlag0802($param['renewalFlag0802'] ?? '');
        $request->setentireExpDiscount($param['entireExpDiscount'] ?? '');
        $request->setdeviceList($param['deviceList'] ?? []);
        $request->setchargingPostList($param['chargingPostList'] ?? []);
        $request->setbusinessLevel($param['businessLevel'] ?? '');
        $request->settaxDocumentDate($param['taxDocumentDate'] ?? '');
        $request->settaxPaidAreaCode($param['taxPaidAreaCode'] ?? '');

        /**
         * @var CommonResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    public function InsuranceConfirm($businessNo, $platOrderNo, $appliInfo, $insuredInfo, $coClauseList, $salesmanAdvice, $uwCountJY = '', $quantityJY = '', $startDateJY = '', $endDateJY = '', $chalCode = '', $userCode = '', $productCode = '', $planCode = '')
    {
        $request = new InsuranceConfirmRequest();
        $request->setbusinessNo($businessNo);
        $request->setplatOrderNo($platOrderNo);
        $request->setappliInfo($appliInfo);
        $request->setinsuredInfo($insuredInfo);
        $request->setcoClauseList($coClauseList);
        $request->setsalesmanAdvice($salesmanAdvice);
        $request->setuwCountJY($uwCountJY);
        $request->setquantityJY($quantityJY);
        $request->setstartDateJY($startDateJY);
        $request->setendDateJY($endDateJY);
        $request->setchalCode($chalCode);
        $request->setuserCode($userCode);
        $request->setproductCode($productCode);
        $request->setplanCode($planCode);

        /**
         * @var CommonResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    public function GetVerifyCode($platOrderNo)
    {
        $request = new GetVerifyCodeRequest();
        $request->setPlatOrderNo($platOrderNo);

        /**
         * @var CommonResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    public function GetPaymentUrl($platOrderNo, $issUserCode)
    {
        $request = new GetPaymentUrlRequest();
        $request->setPlatOrderNo($platOrderNo);
        $request->setIssUserCode($issUserCode);

        /**
         * @var CommonResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    public function OrderStatusQuery($platOrderNo)
    {
        $request = new OrderStatusQueryRequest();
        $request->setPlatOrderNo($platOrderNo);

        /**
         * @var CommonResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    public function UploadFile(UploadFileVisitor $uploadFileVisitor)
    {
        $request = new UploadFileRequest();
        $list = $uploadFileVisitor->fileList;
        if (empty($list)) {
            throw new \Exception("图片不能为空");
        }
        $response = new CommonResponse();
        foreach ($list as $val) {
            $visitor = new UploadFileVisitor();
            $visitor->argc = $uploadFileVisitor->argc;
            $visitor->ciInquiryNo = $uploadFileVisitor->ciInquiryNo;
            $visitor->biInquiryNo = $uploadFileVisitor->biInquiryNo;
            $visitor->fileAppend($val['type'], $val['url'], $val['base64']);
            $request->setVisitor($visitor);
            $response = $this->execute($request);
            usleep(500);
        }
        return $response;
    }

    public function OrderCancel($platOrderNo, $proposalNo, $riskCode, $commitTime, $recallType)
    {
        $request = new OrderCancelRequest();
        $request->setPlatOrderNo($platOrderNo);
        $request->setProposalNo($proposalNo);
        $request->setRiskCode($riskCode);
        $request->setCommitTime($commitTime);
        $request->setRecallType($recallType);
        /**
         * @var CommonResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    public function GetCarVerifyCode($businessNo, $queryDate)
    {
        $request = new GetCarVerifyCodeRequest();
        $request->setBusinessNo($businessNo);
        $request->setQueryDate($queryDate);
        /**
         * @var CommonResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    public function GetOrderNo($businessNo, $proposalNo)
    {
        $request = new GetOrderNoRequest();
        $request->setBusinessNo($businessNo);
        $request->setProposalNo($proposalNo);
        /**
         * @var CommonResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    public function CancelOrderNo($tradeNo, $proposalNo, $attrube1, $attrube2, $operateCode)
    {
        $request = new CancelOrderNoRequest();
        $request->setTradeNo($tradeNo);
        $request->setProposalNo($proposalNo);
        $request->setAttrube1($attrube1);
        $request->setAttrube2($attrube2);
        $request->setOperateCode($operateCode);

        /**
         * @var CommonResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    public function RevokeOrderNo($insuredNo, $userId)
    {
        $request = new RevokeOrderNoRequest();
        $request->setInsuredNo($insuredNo);
        $request->setUserId($userId);

        /**
         * @var CommonResponse $response
         */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 非车产品列表
     * @param NonCarProductListVisitor $nonCarProductListVisitor
     * @return NonCarProductListResponse
     * @version 4.0
     */
    public function nonCarProductList(NonCarProductListVisitor $nonCarProductListVisitor): NonCarProductListResponse
    {
        $request = new NonCarProductListRequest();
        $request->setVisitor($nonCarProductListVisitor);

        /*** @var $response NonCarProductListResponse */
        $response = $this->execute($request);

        return $response;
    }

    public function nonCarInquiry(NonCarInquiryVisitor $nonCarInquiryVisitor)
    {
        // TODO: Implement nonCarInquiry() method.
    }

    public function nonCarUnderwriting(NonCarInquiryVisitor $inquiryPrinter)
    {
        // TODO: Implement nonCarUnderwriting() method.
    }
}
